package club.banyuan.oop;

/**
 * @author edz
 * @version 1.0
 * @date 2020/11/16 下午8:04
 */
public class Student {
    String stuName;
    int stuId;
    int stuScore;
    String stuAddress;

    public Student() {
    }

    //    public Student(){};
//    public Student(String stuName,int stuId,int stuScore,String stuAddress){
//        stuName=stuName;
//        stuAddress=stuAddress;
//        stuId=stuId;
//        stuScore=stuScore;
//    }
    public void setStuName(String newStuName){
        stuName= newStuName;
    }

    public void setStuAddress(String newStuAddress){
        stuAddress = newStuAddress;
    }
    public void setStuId(int newStuId){
        if (newStuId<0||newStuId>50000){
            System.err.println("学号异常");
        }else{
            stuId=newStuId;
        }
    }
    public void setStuScore(int newStuScore){
        if (newStuScore<0||newStuScore>100){
            System.err.println("学生成绩异常");
        }else{
            stuScore=newStuScore;
        }
    }
//    public String getInfo(){
//        return
//    }
    public double[] sort(double[] arr){
        double temp=-1.0;
        for (int i = 0; i <arr.length; i++) {
            for (int j = 0; j <arr.length-1-i ; j++) {
                if(arr[j]<arr[j+1]){
                    temp=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=arr[j];
                }
            }
        }
        return arr;
    }
}

